<?php
// Create a new image instance
$im = imagecreatetruecolor(600, 30) or die('Cannot Initialize new GD image stream');
$black = imagecolorallocate($im, 0, 0, 0);
$grey = imagecolorallocate($im, 128, 128, 128);
$white = imagecolorallocate($im, 255, 255, 255);
$red = imagecolorallocate($im, 255, 0, 0);

// Make the background white
imagefilledrectangle($im, 0, 0, 600, 30, $white);

// Load the gd font and write 'Hello'
$text = $_GET['label'];
$font = 'fonts/armalite.ttf';
//$font = imageloadfont($font);
imagettftext($im, 22, 0, 1, 21, $red, $font, $text);

// Output to browser
header('Content-type: image/png');

imagepng($im);
imagedestroy($im);
?>
